package testappserver;

import java.io.IOException;

public class Main {

    private static String[] args =
            new String[] { "java", "-jar", "..//..//TestAppClient//dist//TestAppClient.jar", "1" };

    private static Server server;
    private static ServerGUI instance;

    public static void main(String[] args) throws IOException {
        instance = new ServerGUI();
        instance.Show();
        server = new Server();
        server.Start();
    }

    public static void RunClient(String number) throws IOException {
        args[3] = number;
        Runtime.getRuntime().exec(args);
    }

    static void Stop() {
        server.Stop();
        instance.Close();
    }

    static void SendMessage(int rand, double newNumber) {
        server.AddCommand(rand, newNumber);
    }

}
